package com.ty.day1;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/22 16:35
 */
public class Six {
    public static void main(String[] args) {
        String str = "abc.a.txt";
        int index = str.lastIndexOf(".");
        String s = "";
        for (int i = 0; i < index; i++) {
            s = s + str.charAt(i);
        }
        System.out.println(s);
        String s1 = str.substring(0, index);
        System.out.println(s1);

        String emil = "2194145064@qq.com";
        if (emil.indexOf("@") < emil.indexOf(".")) {
            if (emil.indexOf(".")!=-1){
                if (emil.indexOf("@") != 0 || emil.indexOf("@") != emil.length()){
                    System.out.println("真邮箱");
                }
            }
        }
    }
}
